<template>
	<view class='community'>
		<!-- 社区选择 -->
		<picker @change="communityChange"  :range="props.data">
			{{community}}
		</picker>
	</view>
</template>

<script setup>
	const props = defineProps({
		data: Array
	})
	const community = ref("请绑定社区")
	const array = ref([])
	const emit = defineEmits(['update-community'])
	function communityChange(e){
		console.log("e", e)
		community.value = props.data[e.detail.value]
		emit('update-community',community.value)
	}
</script>

<style lang="scss" scoped>
	.community {
		margin-top: 10rpx;
		background-color: antiquewhite;
		font-size: 36rpx;
	}
</style>